home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Utilities Professional 1-1500
/
Utilities Professional 1-1500 (1994)(WPD)[!].iso
/
07511000
/
var0888.dms
/
var0888.adf
/
WoManD
/
man
/
Exec
/
Lists
< prev
next >
Wrap
Text File
|
1992-09-19
|
4KB
|
101 lines
LISTS(1) AMIGA DOS EXEC FUNCTIONS LISTS(1)
NAME
Insert(), AddHead(), AddTail(), Remove(), RemHead(), RemTail(),
Enqueue(), FindName().
SYNOPSIS
void Insert(struct List *list, struct Node *node , struct Node *pred)
(A0/A1/A2)
void AddHead(struct List *list, struct Node *node) (A0/A1)
void AddTail(struct List *list, struct Node *node) (A0/A1)
void Remove(struct Node *node) (A1)
struct Node *RemHead(struct List *list) (A0)
struct Node *RemTail(struct List *list) (A0)
void Enqueue(struct List *list, struct Node *node) (A0/A1)
struct Node *FindName(struct List *list, char *name) (A0/A1)
LIBRARY
Exec
OFFSET
Insert 0xea
AddHead 0xf0
AddTail 0xf6
Remove 0xfc
RemHead 0x102
RemTail 0x108
Enqueue 0x10e
FindName 0x114
DESCRIPTION
The functions use the following structures to create linked list of
nodes:
struct Node
{ struct Node *ln_Succ;
struct Node *ln_Pred;
UBYTE ln_Type;
BYTE ln_Pri;
char *ln_Name;
}
struct List
{ struct Node *lh_Head;
struct Node *lh_Tail;
struct Node *lh_TailPred;
UBYTE lh_Type;
UBYTE lh_pad;
}
Before being used, a list must be initialized as follow:
lh_Head must point to lh_Tail.
lh_TailPred must point to lh_HeadTail.
lh_Tail must be zero.
lh_Type must be set to the same data type as that of the nodes
to be kept in this list.
FUNCTIONS
- Insert : inserts the node pointed to by "node" after the node
pointed to by "pred" in the list pointed to by "list".
If pred is NULL or equal to list, then the node is inserted at
the beginning of the list.
list : pointer to the list header.
node : pointer to the node to insert.
pred : pointer to the node to insert after.
- AddHead : inserts the node pointed to by node at the start of the list
pointed to by list.
list : pointer to the list header.
node : pointer to the node to insert.
- AddTail : links the node pointed to by node at the end of the list
pointed to by list. The node becomes the last element of the
list.
list : pointer to the list header.
node : pointer to the node to insert.
- Remove : removes the specified node from its list.
node : the node to remove from the list.
- RemHead : removes the first node of the specified list.
list : the list to truncate.
return : a pointer to the removed node or NULL if the list
was empty.
- RemTail : removes the last node of the specified list.
list : the list to truncate.
return : a pointer to the removed node or NULL if the list
was empty.
- Enqueue : adds a node in the list, keeping the nodes ordered by their
priority (higher priority are at the head of the list.)
list : pointer to the list header.
node : pointer to the node to insert.
- FindName : searches a node in the list with the specified name.
list : pointer to the list header to search in.
name : the name for the node.
return : a pointer to the node found, or zero if none is found.